package com.changpay.zywy.ui.activity.serivce

import android.content.Intent
import com.changpay.zywy.R
import com.changpay.zywy.api.WebApis
import com.changpay.zywy.base.BaseActivity
import com.changpay.zywy.ui.activity.freeze.FreezeActivity
import com.changpay.zywy.ui.activity.web.WebViewActivity
import kotlinx.android.synthetic.main.activity_service.*
import kotlinx.android.synthetic.main.title_right_layout.*


class ServiceActivity : BaseActivity() {
    val ServiceName = arrayOf(
        "设置下级政策", "结算底价修改", "激活返现修改"
        , "自备机入网", "机具调拨签收", "机具回拨", "商户入网",
        "商户费率修改", "商户结算卡修改","冻结管理"
    )

    override fun attachLayoutRes(): Int {
        return R.layout.activity_service
    }

    override fun initData() {
    }


    override fun initView() {
        tv_title.text = "业务办理"
        tv_right.text = "申请明细"
        tv_right.setOnClickListener { startActivity(ApplyDetailActivity::class.java) }
        iv_back.setOnClickListener { finish() }
        iv_back.setOnClickListener { finish() }
        tv_service_one.text = ServiceName[0]
        tv_service_two.text = ServiceName[1]
        tv_service_three.text = ServiceName[2]
        tv_service_four.text = ServiceName[3]
        tv_service_five.text = ServiceName[4]
        tv_service_six.text = ServiceName[5]
        tv_service_seven.text = ServiceName[6]
        tv_service_eight.text = ServiceName[7]
        tv_service_nice.text = ServiceName[8]
        tv_service_ten.text = ServiceName[9]

        ll_service_one.setOnClickListener {
            Intent(this, SelectProjectActivity::class.java).run {
                type = "2"
                putExtra("title", "设置下级政策")
                startActivity(this)
            }
        }
        ll_service_two.setOnClickListener { Intent(this, SelectProjectActivity::class.java).run {
            type = "3"
            putExtra("title", "结算底价修改")
            startActivity(this)
        }}
        ll_service_three.setOnClickListener { Intent(this, SelectProjectActivity::class.java).run {
            type = "4"
            putExtra("title", "激活返现修改")
            startActivity(this)
        }}
        ll_service_four.setOnClickListener { startActivity(SelfProvidMachineActivity::class.java) }
        ll_service_five.setOnClickListener { startActivity(AllowCommitActivity::class.java) }
        ll_service_six.setOnClickListener { Intent(this, SelectProjectActivity::class.java).run {
            type = "5"
            putExtra("title", "激活返现修改")
            startActivity(this)
        } }
        ll_service_seven.setOnClickListener { WebViewActivity.startActivity(this, WebApis.AccessNetwork) }
        ll_service_eight.setOnClickListener {
            Intent(this, SelectProjectActivity::class.java).run {
                type = "0"
                putExtra("title", "商户费率修改")
                startActivity(this)
            }
        }
        ll_service_nice.setOnClickListener {
            Intent(this, SelectProjectActivity::class.java).run {
                type = "1"
                putExtra("title", "商户结算卡修改")
                startActivity(this)
            }
        }
        ll_service_ten.setOnClickListener{
            startActivity(FreezeActivity::class.java)
        }

    }

    override fun start() {

    }
}
